package com.doubi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.doubi.entity.Commenttable;
import com.doubi.mapper.CommenttableMapper;
import com.doubi.service.CommenttableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommenttableServiceImpl extends ServiceImpl<CommenttableMapper, Commenttable> implements CommenttableService {
    @Autowired
    private CommenttableMapper commenttableMapper;


    @Override
    public Commenttable getLastComment() {
        return commenttableMapper.getLastComment();
    }

    @Override
    public int countByRid(int rid) {
        return commenttableMapper.countByRid(rid);
    }

    @Override
    public List<Commenttable> getCommentByRid(List<Integer> rid) {
        return commenttableMapper.getCommentByRid(rid);
    }

    @Override
    public int updateComment(List<Integer> cid) {
        return commenttableMapper.updateComment(cid);
    }

    public Integer getLastCommentCount(Integer releaseId) {
        return commenttableMapper.getLastCommentCount(releaseId);
    }
    /**
     * 评论点赞
     */
    public Integer updateLikeComment(Commenttable commenttable) {
        return commenttableMapper.updateLikeComment(commenttable);
    }
}
